package org.ting.book.component;

import org.ting.book.enums.ResultStatus;
import org.ting.book.model.Result;

public class ResultFail extends ResultGenerator{
    @Override
    public <T> Result<T> getResult(T errMsg) {
        Result<T> result = new Result<>();
        result.setCode(ResultStatus.FAIL);
        result.setErrMsg((String) errMsg);
        return result;
    }

    @Override
    public Result getResult() {
        Result result = new Result<>();
        result.setCode(ResultStatus.FAIL);
        result.setErrMsg("未知错误");
        return result;
    }
}
